package com.wz.utils.batch.exception;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;

import java.sql.SQLException;

@Component
public class MsgException extends Throwable {
    public MsgException() {
    }

    @Autowired
    private JdbcTemplate jdbcTemplate;

    public MsgException(String s) throws SQLException {
        System.out.println("msg  error");
        jdbcTemplate.getDataSource().getConnection().rollback();
    }
}
